﻿using MediatR;
using RBAC.LuFang.API.Application.Command.UserCommand;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.UserHandler
{
    //用户删除
    public class UserDeleteCommandHandler:IRequestHandler<UserDeleteCommand,int>
    {
        private readonly IUserService userService;

        public UserDeleteCommandHandler(IUserService userService)
        {
            this.userService = userService;
        }

        public async Task<int> Handle(UserDeleteCommand request, CancellationToken cancellationToken)
        {
            return await userService.DelUser(request.id);
        }
    }
}
